Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use non-header-including byte size field for tcp connections #726

Closed
wants to merge 1 commit into from

Conversation

lisaSW
Copy link
Contributor

@lisaSW lisaSW commented Mar 21, 2022

Closes #725

  • updated incoming/outgoing bytes for tcp connections to use the orig_bytes/resp_bytes fields, which do not include header size. Non-tcp connections will use orig_ip_bytes/resp_ip_bytes, which include the header size.
  • field usage is now consistent

…sp_bytes fields, while non-tcp connections use orig_ip_bytes/resp_ip_bytes
@lisaSW lisaSW requested review from Zalgo2462 and ethack March 21, 2022 20:24
Copy link
Collaborator

@ethack ethack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to me.

There is one edge case I've seen that may be worth addressing: when the OrigBytes/RespBytes are incorrect. In this case they will be greater than the OrigIPBytes/RespIPBytes values. But I think that should never actually be true, so another check could be to fall back to using OrigIPBytes/RespIPBytes if OrigBytes > OrigIPBytes || RespBytes > RespIPBytes.

Copy link
Contributor

@Zalgo2462 Zalgo2462 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks compatibility with ACM's Active Flow. Active Flow only reports the IP bytes fields since this is what is available in netflow v9 data. Annoyingly, it falsely reports the OrigBytes and RespBytes fields as 0's instead of unset.

We either need to add a special case in here for RITA, patch Active Flow, or both.

Conflicting Active Flow code: https://github.com/activecm/AC-Hunter/blob/8c7b481e2e757c8dc2e6c59de42c753f458a8897/active-flow/writer/bro/util.go#L42

@lisaSW lisaSW closed this Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use non-header-including byte size field for tcp connections
3 participants